package cn.hchaojie.camp.day02;

/**
 * 定义二维数组
 * 
 * @author hchaojie
 *
 */
public class DemoTwoDimentionArray {
	public static void main(String[] args) {
		double[] englishScores = {100, 88, 99, 50, 60};
		double[] mathScores = {99, 88, 55, 44, 55};
		
		double[][] scores = new double[2][5];
		
		// 初始化
		double[] a1 = scores[0];	// 所有的英语成绩
		double[] a2 = scores[1];	// 所有的数学成绩
		
		scores[0][0] = 50;
		scores[0][1] = 88;

		
		// 静态初始化
		double[][] scores1 = {
			{100, 88, 99, 50, 60},
			{99, 88, 55, 44, 55}
		};
		
		// 遍历二维数组
		for (int i = 0; i < scores1.length; i++) {
			for (int j = 0; j < scores1[i].length; j++) {
				System.out.print(scores1[i][j] + "\t");
			}
			
			System.out.println();
		}

	}
}
